<template>
	<view>
		<!-- 商品项 -->
		<view v-for="(item,index) in dataList" :key="index">
			<view class="goods-item" @click="gotoDetail(item)">
				<view class="" style="position: relative;">
					<image src="/static/icon/yinpin.png" class="goods-image" mode="aspectFit" />
					<view class="bg-main-green font-12 text-center"
						style="height: 40rpx;width: 80rpx; border-radius: 28rpx 0 8rpx 0;position: absolute; left: 0; top: 0;">
						赠品</view>
					<view class="bg-main-yellow font-12 text-center"
						style="height: 40rpx;width: 200rpx; border-radius: 0 0 28rpx 28rpx;position: absolute; left: 0; bottom: 0;">
						客户毛利2.77%</view>
		
				</view>
		
		
				<view class="goods-info">
					<!-- 顶部信息 -->
					<view class="info-top">
						<text class="goods-name">安神糖浆</text>
						<text class="goods-factory"><text class="goods-spec">120ml</text>贵州益佰制药股份有限公司</text>
					</view>
		
					<view style="height: 40rpx;"></view>
					<!-- 价格行 -->
					<view class="flex justify-between align-center" style="height: 90rpx;">
						<view class="price-row">
							<view class="current-price">￥7.84</view>
							<view class="retail-price">零售￥10</view>
						</view>
						<view v-if="index==0" class=" bg-main-yellow font-18 flex align-center justify-center"
							style="border-radius: 50%;width: 40rpx;height: 40rpx;"
							@click.stop="showPopAddShop('addShop')">
							+
						</view>
						<view v-else class="round cu-btn text-white font-12 sm" style="background-color: #BDBDBD;"
							@click.stop="showPopAddShop('addQueShop')">
							加入缺货登记
						</view>
					</view>
					<!-- 底部信息 -->
					<view class="info-bottom padding-lr-sm padding-tb-xs">
							<view class="stock">库存 1499</view>
							<view class="sales">上月销量 1234</view>
					</view>
					<view>
						<text class="supplier">山西药九九/山西药九九</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"shop-list",
		props: {
			dataList: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			gotoDetail(item) {
				this.$emit('gotoDetail', item)
			},
			showPopAddShop(type) {
				this.$emit('showPopAddShop', type)
			}
		}
	}
</script>

<style scoped lang="scss">
	.goods-item {
		display: flex;
		padding: 20rpx;
		background-color: #fff;
		// position: relative;

		.goods-image {
			width: 200rpx;
			height: 280rpx;
			margin-right: 20rpx;
			border-radius: 28rpx;
			background-color: #F7F7F7;

		}

		.goods-info {
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
		}

		.info-top {
			.goods-name {
				font-size: 32rpx;
				font-weight: bold;
				margin-right: 15rpx;
			}

			.goods-spec {
				font-size: 24rpx;
				color: #666;
				margin-right: 10rpx;
			}

			.goods-factory {
				display: block;
				font-size: 24rpx;
				color: #999;
				margin-top: 10rpx;
			}
		}

		.price-row {
			display: flex;
			align-items: baseline;

			.current-price {
				color: #f60;
				font-size: 36rpx;
				margin-right: 20rpx;
			}

			.retail-price {
				font-size: 24rpx;
				color: #999;
				text-decoration: line-through;
				margin-right: 20rpx;
			}

			
		}

		.info-bottom {
			display: flex;
			justify-content: space-between;
			color: #999;
			background-color: #FAFAFA;
			.stock {
				font-size: 24rpx;
			}
			.sales {
				font-size: 24rpx;
			}
			

		}

		.supplier {
			font-size: 20rpx;
			color: #C5C5C7;
		}

		.action-button {
			position: absolute;
			right: 20rpx;
			bottom: 20rpx;
			background-color: #f60;
			padding: 8rpx 20rpx;
			border-radius: 30rpx;

			.button-text {
				color: #fff;
				font-size: 24rpx;
			}
		}
	}
</style>